/*
 * @Author: Tommy Chen weiyao_85@163.com
 * @Date: 2024-05-08 09:53:39
 * @LastEditors: Tommy Chen
 * @LastEditTime: 2024-05-22
 * @FilePath: /macc.admin.vue/src/project/authSys/store/modules/authCommon/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const state = {
  loginPwd: '', // 用来修改密码使用
  authPolicys: [],
  deviceGroups: [],
  ruleForm: {}, // 规则分布存储用
  sourceForm: {}, // 第三方源存储使用
  thirdPartSources: [],
  deviceTypes: [],
  ldapPasswordTypes: [],
};

const mutations = {
  SET_LDAP_PWD_TYPE_LIST(state, payload) {
    state.ldapPasswordTypes = payload;
  },
  SET_DEVICE_TYPE_LIST(state, payload) {
    state.deviceTypes = payload;
  },
  SET_LOGIN_PWD(state, payload) {
    state.loginPwd = payload;
  },
  SET_DEVICE_GROUP_LIST(state, payload) {
    state.deviceGroups = payload;
  },
  SET_AUTH_POLICY_LIST(state, payload) {
    state.authPolicys = payload;
  },
  SET_AUTH_RULE_FORM(state, payload) {
    state.ruleForm = payload;
  },
  SET_3RD_SOURCE_FORM(state, payload) {
    state.sourceForm = payload;
  },
  SET_3RD_SOURCE_LIST(state, payload) {
    state.thirdPartSources = payload;
  },
};

const getters = {};

export default {
  namespaced: true, //开启命名空间，更好的区分使用stage,防止不同stage模块中的方法重名
  state,
  getters,
  mutations,
};
